package cn.legend.travel.basic.info.dao.persist.repository.impl;

import cn.legend.travel.basic.info.dao.persist.mapper.UserMapper;
import cn.legend.travel.basic.info.dao.persist.repository.UserRepository;
import cn.legend.travel.basic.info.pojo.entity.BlackUser;
import cn.legend.travel.basic.info.pojo.entity.User;
import cn.legend.travel.basic.info.pojo.vo.BlackListVO;
import cn.legend.travel.basic.info.pojo.vo.UserInfoVO;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Repository;

import java.util.List;

@Repository
public class UserRepositoryImpl implements UserRepository {
    @Autowired
    private UserMapper userMapper;


    @Override
    public int insertBlack(List<BlackUser> blackUser) {
        return userMapper.insertBlack(blackUser);
    }

    @Override
    public UserInfoVO selectUserInfoById(Long id) {
        return userMapper.selectUserInfoById(id);
    }

    @Override
    public List<BlackListVO> selectUserInfoByNickname(String nickname) {
        return userMapper.selectUserInfoByNickname(nickname);
    }

    @Override
    public int updateUserInfoByUser(User user) {
        System.err.println(user);
        return userMapper.updateById(user);
    }
}
